package cn.blackbirds.blocks;

import com.wiyun.engine.sound.AudioManager;


public class Globals {

	//棋盘尺寸
	public static final int MAP_WIDTH = 480;
	public static final int MAP_HEIGHT = 800;
	
	//棋盘行列数
	public static final int MAP_ROWS = 8;
	public static final int MAP_COLS = 6;

	// 棋盘内部四个点
	public static final int BORDER_LEFT = 15;
	public static final int BORDER_BOTTOM = 90;
	public static final int BORDER_RIGHT = 465;
	public static final int BORDER_UPPER = 690;

	//棋子尺寸
	public static final int BLOCK_WIDTH = 75;
	public static final int BLOCK_HEIGHT = 75;
	
	

	// 初始棋盘显示棋子数
	public static int INITIAL_BLOCKS = 4;

	// 再生棋子数
	public static int RECREATE_BLOCKS = 3;

	// 几个棋子毗邻即消失
	public static int CONTINUOUS_BLOCKS = 4;

	// 移动时间间隔，数据值越小棋子移动越快
	public static float MOVE_DURATION = 0.118f;
	
	//背景音乐
	public static void onPlayBg() {
		AudioManager.playBackgroundMusic(R.raw.bg_mp3, AudioManager.FORMAT_MP3, -1);
	}
	
	public static void onStopBg() {
		AudioManager.stopBackgroundMusic();
	}
	
	public static void initEffect(){
		//按钮音效
		AudioManager.preloadEffect(R.raw.button_wav, AudioManager.FORMAT_WAV);
		//消除音效
		AudioManager.preloadEffect(R.raw.remove_mp3, AudioManager.FORMAT_MP3);
		//移动音效
		AudioManager.preloadEffect(R.raw.move_mp3, AudioManager.FORMAT_MP3);
		//Game Over音效
		AudioManager.preloadEffect(R.raw.gameover_mp3, AudioManager.FORMAT_MP3);
	}
	
	public static void playButton(){
		AudioManager.playEffect(R.raw.button_wav);
	}
	
	public static void playRemove(){
		AudioManager.playEffect(R.raw.remove_mp3);
	}

	public static void playMove(){
		AudioManager.playEffect(R.raw.move_mp3);
	}
	
	public static void playGameover(){
		AudioManager.playEffect(R.raw.gameover_mp3);
	}
}
